package ldh.fx.adminfx;

import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import ldh.fx.adminfx.commpont.grid.GridTable;
import ldh.fx.adminfx.util.LoggerUtil;
import ldh.fx.adminfx.util.RegionUtil;

import java.util.logging.Logger;

public class AdminFxGui extends AbstractFxGui {

    private final static Logger LOGGER = LoggerUtil.getFileLogger(AdminFxGui.class);

    @Override
    protected Pane createMainPane() {
//        return new AdminPane();
        return RegionUtil.loadFxml("/fxml/AdminPane.fxml");
    }

    @Override
    protected void initCss() {
        LOGGER.info("init css!!!");
        super.initCss();
        addCss("黑色", AbstractFxGui.class.getResource("/css/types/dark-home.css").toExternalForm());
        addCss("蓝色", AbstractFxGui.class.getResource("/css/types/blue-home.css").toExternalForm());
        addCss("绿色", AbstractFxGui.class.getResource("/css/types/green-home.css").toExternalForm());
        addCss("赤金", AbstractFxGui.class.getResource("/css/types/gold-home.css").toExternalForm());
        addCss("橙色", AbstractFxGui.class.getResource("/css/types/salmon-home.css").toExternalForm());
        addCss("灰色", AbstractFxGui.class.getResource("/css/types/gray-home.css").toExternalForm());
        addCss("象牙白", AbstractFxGui.class.getResource("/css/types/white-home.css").toExternalForm());
    }

    @Override
    protected void loadOtherCss(Scene scene){
//        scene.getStylesheets().add(AbstractFxGui.class.getResource("/css/Home.css").toExternalForm());
        scene.getStylesheets().add(GridTable.class.getResource("/css/common/GridTable.css").toExternalForm());
        scene.getStylesheets().add(this.getClass().getResource("/css/component/table.css").toExternalForm());
        scene.getStylesheets().add(this.getClass().getResource("/css/types/common-home.css").toExternalForm());
    }

    public static void main(String[] args) {
        launch(args);
    }
}
